//
// Geometry.cs
//
// Copyright (C) 2006 Alp Toker <alp@atoker.com>
// Copyright (C) 2008 Lukas Lipka <lukaslipka@gmail.com>
//

using System;

namespace Dashboard.Mint.Physics
{
	public struct Point
	{
		public static Point Origin = new Point (0, 0);

		public double X;
		public double Y;

		public Point (double x, double y)
		{
			this.X = x;
			this.Y = y;
		}

		public static Point operator + (Point a, Vector b)
		{
			return new Point (a.X + b.X, a.Y + b.Y);
		}

		public static Point operator - (Point a, Vector b)
		{
			return new Point (a.X - b.X, a.Y - b.Y);
		}

		public static Vector operator - (Point a, Point b)
		{
			return new Vector (a.X - b.X, a.Y - b.Y);
		}

		//?
		public static Point operator / (Point a, Vector b)
		{
			return new Point (a.X / b.X, a.Y / b.Y);
		}
	}

	public struct Vector
	{
		public double X;
		public double Y;

		public Vector (double x, double y)
		{
			this.X = x;
			this.Y = y;
		}

		public static Vector operator + (Vector a, Vector b)
		{
			return new Vector (a.X + b.X, a.Y + b.Y);
		}

		public static Vector operator - (Vector a, Vector b)
		{
			return new Vector (a.X - b.X, a.Y - b.Y);
		}

		//sanity check this
		/*public static Vector operator * (Vector a, Vector b)
		{
			return new Vector (a.X * b.X, a.Y * b.Y);
		}*/

		//doesn't make sense
		/*public static Vector operator / (Vector a, Vector b)
		{
			return new Vector (a.X / b.X, a.Y / b.Y);
		}*/

		public static Vector operator * (Vector a, double b)
		{
			return new Vector (a.X * b, a.Y * b);
		}

		//?
		public static Vector operator * (double a, Vector b)
		{
			return new Vector (b.X * a, b.Y * a);
		}

		public static Vector operator / (Vector a, double b)
		{
			return new Vector (a.X / b, a.Y / b);
		}
	}
}
